# -*- coding:utf-8 -*-
'''
@Project     : fypy

@File        : jpssscene.py

@Modify Time :  2024/4/10 14:03   

@Author      : fypy Team    

@Version     : 1.0   

@Description :

'''
import os
import sys
import numpy as np
import datetime

from osgeo import gdal, gdalconst, osr, ogr

from fypy.tools.BaseAlgorithms import BaseAlgorithms
from fypy.tools.tifpro import getDateSet
from fypy.tools.hdfpro import writehdf, readhdf


class JPSSScene(BaseAlgorithms) :

    def __init__(self):
        self.TempFile = []

    def Calibration(self, filename, sdsname):

        Reflectance = readhdf(filename, '/All_Data/VIIRS-M%d-SDR_All/Reflectance' %(bandid))
        Factors     = readhdf(filename, '/All_Data/VIIRS-M%d-SDR_All/ReflectanceFactors' %(bandid))

        ref = Reflectance * Factors[0] + Factors[1]
        ref[Reflectance>60000] = np.nan